<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
      <el-form-item label="司机姓名" prop="driverName">
        <el-input v-model="queryParams.driverName" placeholder="请输入司机姓名" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="创建时间">
        <el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
          range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
      </el-form-item>
      <el-form-item label="最近活动时间" prop="lastWorkTime">
        <el-date-picker clearable v-model="queryParams.lastWorkTime" type="date" value-format="yyyy-MM-dd"
          placeholder="请选择最近工作时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="联系方式" prop="mobile">
        <el-input v-model="queryParams.mobile" placeholder="请输入联系方式" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="部门名称 " prop="deptName">
        <el-input v-model="queryParams.deptName" placeholder="请输入部门名称 " clearable @keyup.enter.native="handleQuery" />
      </el-form-item>

      <el-form-item label="工作天数" prop="workDay">
        <el-input v-model="queryParams.workDay" placeholder="请输入工作天数" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>

      <!-- <el-form-item label="年龄" prop="age">
        <el-input v-model="queryParams.age" placeholder="请输入年龄" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="身高" prop="height">
        <el-input v-model="queryParams.height" placeholder="请输入身高" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="体重" prop="weight">
        <el-input v-model="queryParams.weight" placeholder="请输入体重" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="是否抽烟喝酒" prop="drink">
        <el-input v-model="queryParams.drink" placeholder="请输入是否抽烟喝酒" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="紧急联系电话" prop="emerCall">
        <el-input v-model="queryParams.emerCall" placeholder="请输入紧急联系电话" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="部门ID" prop="deptId">
        <el-input v-model="queryParams.deptId" placeholder="请输入部门ID" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      
      <el-form-item label="空闲状态" prop="workState">
        <el-input v-model="queryParams.workState" placeholder="请输入空闲状态" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="负责车辆数量" prop="carChargeQty">
        <el-input v-model="queryParams.carChargeQty" placeholder="请输入负责车辆数量" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="派单记录数" prop="orderRecordQty">
        <el-input v-model="queryParams.orderRecordQty" placeholder="请输入派单记录数" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      
      <el-form-item label="工作年限" prop="workYear">
        <el-input v-model="queryParams.workYear" placeholder="请输入工作年限" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      
      <el-form-item label="评分" prop="score">
        <el-input v-model="queryParams.score" placeholder="请输入评分" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="夜班/加班" prop="nightShift">
        <el-input v-model="queryParams.nightShift" placeholder="请输入夜班/加班" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="语言能力" prop="language">
        <el-input v-model="queryParams.language" placeholder="请输入语言能力" clearable @keyup.enter.native="handleQuery" />
      </el-form-item> -->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <!-- <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
          v-hasPermi="['system:info:add']">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
          v-hasPermi="['system:info:edit']">修改</el-button>
      </el-col> -->
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
          v-hasPermi="['system:info:remove']">删除</el-button>
      </el-col>
      <!-- <el-col :span="1.5">
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
          v-hasPermi="['system:info:export']">导出</el-button>
      </el-col> -->
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange" @row-dblclick="dbclick">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID" align="center" prop="id" />
      <el-table-column label="头像" align="center" prop="headImg" />
      <el-table-column label="部门ID" align="center" prop="deptId" />
      <el-table-column label="部门名称 " align="center" prop="deptName" />
      <el-table-column label="司机姓名" align="center" prop="driverName" />
      <el-table-column label="联系方式" align="center" prop="mobile" />
      <el-table-column label="空闲状态" align="center" prop="workState" />
      <el-table-column label="负责车辆数量" align="center" prop="carChargeQty" />
      <el-table-column label="派单记录数" align="center" prop="orderRecordQty" />
      <el-table-column label="工作天数" align="center" prop="workDay" />
      <el-table-column label="司机类型" align="center" prop="driverType" />
      <el-table-column label="最近工作时间" align="center" prop="lastWorkTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.lastWorkTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>

      <!-- <el-table-column label="年龄" align="center" prop="age" />
      <el-table-column label="身高" align="center" prop="height" />
      <el-table-column label="体重" align="center" prop="weight" />
      <el-table-column label="性别" align="center" prop="sex" />
      <el-table-column label="是否抽烟喝酒" align="center" prop="drink" />
      <el-table-column label="家庭状况" align="center" prop="familyDesc" />
      <el-table-column label="紧急联系电话" align="center" prop="emerCall" />
      <el-table-column label="现居地" align="center" prop="livePlace" />
      <el-table-column label="行驶证" align="center" prop="drivingLicense" />


      <el-table-column label="工作年限" align="center" prop="workYear" />
      <el-table-column label="驾驶证" align="center" prop="drivingCard" />
      
      <el-table-column label="评分" align="center" prop="score" />
      <el-table-column label="可工作区域" align="center" prop="workArea" />
      <el-table-column label="可操作吨位型号" align="center" prop="driveCarModel" />
      <el-table-column label="夜班/加班" align="center" prop="nightShift" />
      <el-table-column label="语言能力" align="center" prop="language" />
      <el-table-column label="境外工作经验" align="center" prop="overseaWork" /> -->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-s-check" @click="handleAudit(scope.row)"
            v-hasPermi="['system:info:edit']">审批</el-button>
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
            v-hasPermi="['system:info:remove']">删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />

    <!-- 添加或修改司机列对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="司机姓名" prop="driverName">
          <el-input v-model="form.driverName" placeholder="请输入司机姓名" />
        </el-form-item>
        <el-form-item label="头像" prop="headImg">
          <el-input v-model="form.headImg" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="部门ID" prop="deptId">
          <el-input v-model="form.deptId" placeholder="请输入部门ID" />
        </el-form-item>
        <el-form-item label="部门名称 " prop="deptName">
          <el-input v-model="form.deptName" placeholder="请输入部门名称 " />
        </el-form-item>
        <el-form-item label="联系方式" prop="mobile">
          <el-input v-model="form.mobile" placeholder="请输入联系方式" />
        </el-form-item>
        <el-form-item label="行驶证" prop="drivingLicense">
          <el-input v-model="form.drivingLicense" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="空闲状态" prop="workState">
          <el-input v-model="form.workState" placeholder="请输入空闲状态" />
        </el-form-item>
        <el-form-item label="负责车辆数量" prop="carChargeQty">
          <el-input v-model="form.carChargeQty" placeholder="请输入负责车辆数量" />
        </el-form-item>
        <el-form-item label="派单记录数" prop="orderRecordQty">
          <el-input v-model="form.orderRecordQty" placeholder="请输入派单记录数" />
        </el-form-item>
        <el-form-item label="工作天数" prop="workDay">
          <el-input v-model="form.workDay" placeholder="请输入工作天数" />
        </el-form-item>
        <el-form-item label="驾驶证" prop="drivingCard">
          <el-input v-model="form.drivingCard" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="最近工作时间" prop="lastWorkTime">
          <el-date-picker clearable v-model="form.lastWorkTime" type="date" value-format="yyyy-MM-dd"
            placeholder="请选择最近工作时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="评分" prop="score">
          <el-input v-model="form.score" placeholder="请输入评分" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>


    <!-- 审批对话框 -->
    <el-dialog title="审批" :visible.sync="auditOpen" width="500px" append-to-body>
      <el-form ref="auditForm" :model="auditForm" :rules="auditRules" label-width="80px">
        <el-form-item label="审批状态" prop="driverName">
          <template>
            <el-radio v-model="radio" label="1">通过</el-radio>
            <el-radio v-model="radio" label="2">驳回</el-radio>
          </template>
        </el-form-item>
        <el-form-item label="司机类型" prop="headImg">
          <el-select v-model="customerType" placeholder="请选择">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitAuditForm">确 定</el-button>
        <el-button @click="cancelAudit">取 消</el-button>
      </div>
    </el-dialog>


    <!-- 司机详情 -->
    <el-dialog title="司机详情" :visible.sync="detailOpen" width="1200px" height="1000px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-row :gutter="20">
          <el-col :span="6">
            <div class="grid-content bg-purple-dark">
              <el-form-item label="头像" prop="tel">
                <el-avatar :size="100" :src="form.headImgUrl"></el-avatar>
              </el-form-item>
              <el-form-item label="姓名" prop="name">
                <el-input v-model="form.name" />
              </el-form-item>
              <el-form-item label="联系方式" prop="tel">
                <el-input v-model="form.tel" />
              </el-form-item>
              <el-form-item label="评分" prop="tel">
                <el-input v-model="form.tel" />
              </el-form-item>
              <el-form-item label="状态" prop="tel">
                <el-input v-model="form.tel" />
              </el-form-item>
              <el-form-item label="已完成订单数" prop="tel">
                <el-input v-model="form.tel" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="18">
            <el-row>
              <el-card class="box-card">
                <div slot="header" class="clearfix">
                  <span>身份证正反面</span>
                </div>
                <el-image v-for="(image, index) in images" :key="index" :src="image.url" class="image-item"
                  :preview-src-list="srcList">
                </el-image>
              </el-card>
            </el-row>

            <el-row>
              <el-col :span="24">
                <el-card class="box-card">
                  <div slot="header" class="clearfix">
                    <span>负责车辆</span>
                  </div>
                  <div class="grid-content bg-purple-dark">
                    <el-table v-loading="loading" :data="detailList" @selection-change="handleSelectionChange">
                      <el-table-column label="ID" align="center" prop="id" />
                      <el-table-column label="车号" align="center" prop="carNo" />
                      <el-table-column label="车辆品牌" align="center" prop="carBrand" />
                      <el-table-column label="车牌" align="center" prop="carPlate" />
                      <el-table-column label="车辆年限" align="center" prop="carYear" />
                      <el-table-column label="车型" align="center" prop="carModel" />
                      <el-table-column label="吨位" align="center" prop="carWeight" />
                      <el-table-column label="收费标准" align="center" prop="basicCharge" />
                      <el-table-column label="数量" align="center" prop="carQty" />
                      <el-table-column label="位置" align="center" prop="address" />
                      <el-table-column label="位置坐标" align="center" prop="location" />
                      <el-table-column label="主臂长" align="center" prop="mainArmLength" />
                      <el-table-column label="最大起重" align="center" prop="holdWeight" />
                      <el-table-column label="年检时间" align="center" prop="checkTime" width="180">
                        <template slot-scope="scope">
                          <span>{{ parseTime(scope.row.checkTime, "{y}-{m}-{d}") }}</span>
                        </template>
                      </el-table-column>
                      <el-table-column label="保险" align="center" prop="insurance" />
                      <el-table-column label="责任人ID" align="center" prop="chargePersonId" />
                      <el-table-column label="责任人名称" align="center" prop="chargePersonName" />
                      <el-table-column label="锁车状态，0：未锁车，1：锁车" align="center" prop="lockState" />
                      <el-table-column label="状态 1：闲置，2：工作中" align="center" prop="workState" />
                      <el-table-column label="位置更新时间" align="center" prop="locationUpdateTime" width="180">
                        <template slot-scope="scope">
                          <span>{{
                            parseTime(scope.row.locationUpdateTime, "{y}-{m}-{d}")
                          }}</span>
                        </template>
                      </el-table-column>
                    </el-table>

                  </div>
                </el-card>
                <el-card class="box-card">
                  <div slot="header" class="clearfix">
                    <span>派单记录</span>
                  </div>
                  <div class="grid-content bg-purple-dark">
                    <el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
                      <el-table-column type="selection" width="55" align="center" />
                      <el-table-column label="订单ID" align="center" prop="id" />
                      <el-table-column label="订单号" align="center" prop="orderNo" />
                      <el-table-column label="下单用户ID" align="center" prop="userId" />
                      <el-table-column label="下单用户姓名" align="center" prop="userName" />
                      <el-table-column label="车辆ID" align="center" prop="carId" />
                      <el-table-column label="车辆编号" align="center" prop="carNo" />
                      <el-table-column label="车辆数量 " align="center" prop="carQty" />
                      <el-table-column label="路基箱数量" align="center" prop="subgradeBoxQty" />
                      <el-table-column label="吊车吨位" align="center" prop="carWeight" />
                      <el-table-column label="机长数量" align="center" prop="captain" />
                      <el-table-column label="施工方式" align="center" prop="chargeType" />
                      <el-table-column label="入场时间" align="center" prop="beginTime" width="180">
                        <template slot-scope="scope">
                          <span>{{ parseTime(scope.row.beginTime, '{y}-{m}-{d}') }}</span>
                        </template>
                      </el-table-column>
                      <el-table-column label="结束时间" align="center" prop="endTime" width="180">
                        <template slot-scope="scope">
                          <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
                        </template>
                      </el-table-column>
                      <el-table-column label="取车时间" align="center" prop="pickCarTime" width="180">
                        <template slot-scope="scope">
                          <span>{{ parseTime(scope.row.pickCarTime, '{y}-{m}-{d}') }}</span>
                        </template>
                      </el-table-column>
                      <el-table-column label="付款方式 0：0天，30：30天，60：60天，90：90天" align="center" prop="payType" />
                      <el-table-column label="保险" align="center" prop="insurance" />
                      <el-table-column label="维护" align="center" prop="upkeep" />
                      <el-table-column label="工作时长" align="center" prop="workMonth" />
                      <el-table-column label="地址ID" align="center" prop="workAddressId" />
                      <el-table-column label="地址" align="center" prop="workAddress" />
                      <el-table-column label="施工场景" align="center" prop="workEnv" />
                      <el-table-column label="工作内容" align="center" prop="workContent" />
                      <el-table-column label="是否有保证金 0：没有，1：有" align="center" prop="earnestMoneyFlag" />
                      <el-table-column label="保证金" align="center" prop="earnestMoney" />
                      <el-table-column label="折扣" align="center" prop="discount" />
                      <el-table-column label="税率" align="center" prop="rate" />
                      <el-table-column label="运输方式" align="center" prop="shipMode" />
                      <el-table-column label="增配驾驶员" align="center" prop="addDriver" />
                      <el-table-column label="增配驾驶员金额" align="center" prop="addDriverPrice" />
                      <el-table-column label="就餐" align="center" prop="eat" />
                      <el-table-column label="住宿" align="center" prop="sleep" />
                      <el-table-column label="燃油" align="center" prop="oil" />
                      <el-table-column label="拆卸人工" align="center" prop="dismantlePerson" />
                      <el-table-column label="拆卸辅助吊车" align="center" prop="dismantleCar" />
                      <el-table-column label="组装辅助吊车" align="center" prop="packageCar" />
                      <el-table-column label="安装人工" align="center" prop="installPerson" />
                      <el-table-column label="年检检测" align="center" prop="yearCheck" />
                      <el-table-column label="委托检测" align="center" prop="entrustCheck" />
                      <el-table-column label="环保检测" align="center" prop="envCheck" />
                      <el-table-column label="使用登记证" align="center" prop="certificate" />
                      <el-table-column label="体检" align="center" prop="medical" />
                      <el-table-column label="总金额" align="center" prop="totalPrice" />
                      <el-table-column label="司机ID" align="center" prop="driverId" />
                      <el-table-column label="司机名称" align="center" prop="driverName" />
                      <el-table-column label="合同编号" align="center" prop="contractNo" />
                      <el-table-column label="订单状态" align="center" prop="orderState" />
                      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                        <template slot-scope="scope">
                          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
                            v-hasPermi="['system:order:edit']">修改</el-button>
                          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
                            v-hasPermi="['system:order:remove']">删除</el-button>
                        </template>
                      </el-table-column>
                    </el-table>

                  </div>
                </el-card>
                <el-card class="box-card">
                  <div slot="header" class="clearfix">
                    <span>用户评价</span>
                  </div>
                  <div class="grid-content bg-purple-dark">
                    <el-table v-loading="loading" :data="evaluateList" @selection-change="handleSelectionChange">
                      <el-table-column type="selection" width="55" align="center" />
                      <el-table-column label="ID" align="center" prop="id" />
                      <el-table-column label="用户微信ID" align="center" prop="wxId" />
                      <el-table-column label="用户姓名" align="center" prop="customerName" />
                      <el-table-column label="联系方式 " align="center" prop="customerTel" />
                      <el-table-column label="用户头像" align="center" prop="customerHeadUrl" />
                      <el-table-column label="态度良好" align="center" prop="attitude" />
                      <el-table-column label="工作认真" align="center" prop="work" />
                      <el-table-column label="超高效率" align="center" prop="efficiency" />
                      <el-table-column label="评价时间" align="center" prop="evaluateTime" width="180">
                        <template slot-scope="scope">
                          <span>{{ parseTime(scope.row.evaluateTime, '{y}-{m}-{d}') }}</span>
                        </template>
                      </el-table-column>
                      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                        <template slot-scope="scope">
                          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
                            v-hasPermi="['system:evaluate:edit']">修改</el-button>
                          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
                            v-hasPermi="['system:evaluate:remove']">删除</el-button>
                        </template>
                      </el-table-column>
                    </el-table>
                  </div>
                </el-card>
              </el-col></el-row>
          </el-col>
        </el-row>
      </el-form>
    </el-dialog>


  </div>
</template>

<script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/system/info";

export default {
  name: "Info",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 司机列表格数据
      infoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      //创建时间搜索框
      dateRange: [],

      //是否显示详情
      detailOpen: false,

      auditForm: {},

      auditRules: {},

      //审批弹出页面
      auditOpen: false,
      radio: '1',
      customerType: "",
      options: [{
        value: '选项1',
        label: '200吨'
      }, {
        value: '选项2',
        label: '300吨'
      }, {
        value: '选项3',
        label: '400吨'
      }, {
        value: '选项4',
        label: '500吨'
      }, {
        value: '选项5',
        label: '600吨'
      }],

      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        driverName: null,
        headImg: null,
        deptId: null,
        deptName: null,
        mobile: null,
        drivingLicense: null,
        workState: null,
        carChargeQty: null,
        orderRecordQty: null,
        workDay: null,
        drivingCard: null,
        lastWorkTime: null,
        score: null,
      },
      images: [
        {
          id: 1,
          url: "http://localhost:8080/profile/upload/2024/09/12/bg_20240912204055A014.jpg",
        },
        {
          id: 2,
          url: "http://localhost:8080/profile/upload/2024/09/12/bg_20240912204055A014.jpg",
        }
      ],
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        driverName: [
          { required: true, message: "司机姓名不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询司机列列表 */
    getList() {
      this.loading = true;
      listInfo(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
        this.infoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        driverName: null,
        headImg: null,
        deptId: null,
        deptName: null,
        mobile: null,
        drivingLicense: null,
        workState: null,
        carChargeQty: null,
        orderRecordQty: null,
        workDay: null,
        drivingCard: null,
        lastWorkTime: null,
        score: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.dateRange = [];
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加司机列";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getInfo(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改司机列";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateInfo(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addInfo(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除司机列编号为"' + ids + '"的数据项？').then(function () {
        return delInfo(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => { });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/info/export', {
        ...this.queryParams
      }, `info_${new Date().getTime()}.xlsx`)
    },
    dbclick(row) {
      console.log(row);
      this.detailOpen = true;
      const id = row.id || this.ids
      // getCustomer(id).then(response => {
      //   this.form = response.data;
      // });

      // listHead({ "customerId": id }).then(response => {
      //   this.headList = response.rows;
      // });
    },
    /** 修改按钮操作 */
    handleAudit(row) {
      const id = row.id || this.ids;
      this.auditOpen = true;
    },

    submitAuditForm() {
      this.$refs["auditForm"].validate(valid => {
        if (valid) {
          if (this.auditForm.id != null) {
            // updateMaintain(this.form).then(response => {
            //   this.$modal.msgSuccess("修改成功");
            //   this.open = false;
            //   this.getList();
            // });
          } else {
            // addMaintain(this.form).then(response => {
            this.$modal.msgSuccess("新增成功");
            this.auditOpen = false;
            this.getList();
            // });
          }
        }
      });
    },

    // 取消按钮
    cancelAudit() {
      this.auditOpen = false;
      //this.reset();
    },
  }
};
</script>

<style>
.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  /* 设置间隔距离 */
}

.image-item {
  /* 根据需要设置图片样式 */
  width: 150px;
  height: 150px;
  margin-left: 10px;
}
</style>
